
<!DOCTYPE html>
<html>
<head lang="zh">
    <meta charset="UTF-8">
    <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/jquery.easyui.min.js"></script>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/jquery-easyui-1.5.5.2/themes/icon.css">
    <title>首页</title>
</head>

<body class="easyui-layout">
<div data-options="region:'north',title:'网站导航栏',split:false" style="height:100px;"></div>
<div data-options="region:'south',title:'友情链接',split:false" style="height:100px;"></div>
<div data-options="region:'west',title:'菜单'" style="width:300px;">
    <ul id="tt"></ul>
</div>   	`
<div data-options="region:'center',title:'内容'" style="padding:5px;background:#eee;"></div>
</body>

<script>
    //tree构建方法
    $("#tt").tree({
        url:"sidebarTree.jsp",//远程数据的地址
        method:"POST",//访问方式
        lines:true,//显示虚线
        onClick: function(node){
            //node.text拿到的是每一个节点的名字
            //node.attributes.pid拿到attributes下的pid的值

            if(node.attributes.pid){
                console.log("你是小彩蛋")
            }else{
                //0本身就是false
                console.log("你是大菜单");
            }
        }

    })


</script>

</html>